<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.hrm.User" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
    //用request得到
    String frUrl = request.getParameter("frUrl");
    String strRequestid = request.getParameter("requestid");
    //out.print(frUrl);
    if (frUrl != null && frUrl.length() > 0
            && null != strRequestid && strRequestid.length() > 0) {
        //数据库操作
        RecordSet rsTable = new RecordSet();
        String strTable = "";
        rsTable.execute("select tablename  from workflow_bill where id = (select formid from workflow_base where id=(select workflowid from workflow_requestbase  where requestid='" + strRequestid + "') and isbill=1)");
        if (rsTable.next()) {
            strTable = rsTable.getString("tablename");
        }
        //获取发起人
        String fqUser = "";
        //rsTable.execute("select dlm from  " + strTable + " where requestid = '"+strRequestid+"'");
        rsTable.execute("select loginid from " + strTable + " left join HRMRESOURCE on sqr = HRMRESOURCE.id where requestid = '" + strRequestid + "'");
        if (rsTable.next()) {
            fqUser = rsTable.getString("loginid");
        }
        //获取登陆人员
        User user = (User) request.getSession(true).getAttribute("weaver_user@bean");
        //获取当前登录人的loginid
        String strLoginid = Util.null2String(user.getLoginid());
        //如果包含? 则加参数&
        if (frUrl.contains("?")) {
            frUrl = frUrl + "&user=" + strLoginid;
        } else {
            frUrl = frUrl + "?user=" + strLoginid;
        }
        frUrl = frUrl + "&fqUser=" + fqUser;
        //out.print(frUrl);
        //https://oa.chinaerdos.com/weavernorth/loginfr.jsp?frUrl=http://finebi.chinaerdos.com:8181/webroot/decision?&requestid=$requestid$
//        if (frUrl.contains("https://finebi.chinaerdos.com:8181/")) {
//            frUrl = frUrl.replaceAll("https", "http");
//        }
        response.sendRedirect(frUrl);
    }
%>